package com.weigang.mdm;

import com.siperian.sif.message.Field;
import com.siperian.sif.message.Record;
import com.weigang.util.FieldUtil;

import java.io.Serializable;

/**
 * @author whj
 * @version 1.0
 * @date 2022/5/26 11:37
 * @describe 低易实体 包含销售 工厂 关系等
 */
public class CConConsumables implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * rowid_object 行id 对象
     */
    public static final String ROWID_OBJECT = "ROWID_OBJECT";
    /**
     * second_class 低值易耗二级分类
     */
    private static final String SECOND_CLASS ="SECOND_CLASS";

    /**
     * third_class 低值易耗三级分类
     */
    private static final String THIRD_CLASS="THIRD_CLASS";

    /**
     * is_assign_factory 是否指定厂家
     */
    private static final String IS_ASSIGN_FACTORY="IS_ASSIGN_FACTORY";

    /**
     * demension_unit_code 尺寸单位
     */
    private static final String DEMENSION_UNIT_CODE="DEMENSION_UNIT_CODE";

    /**
     * mat_class_code 物料类别编码
     */
    private static final String MAT_CLASS_CODE="MAT_CLASS_CODE";


    /**
     * mat_type_code 物料类型编码
     */
    private static final String MAT_TYPE_CODE="MAT_TYPE_CODE";

    /**
     * mat_desc 物料描述
     */
    private static final String MAT_DESC="MAT_DESC";

    /**
     * mat_name 物料名称
     */
    private static final String MAT_NAME="MAT_NAME";

    /**
     * mat_material 物料材质
     */
    private static final String MAT_MATERIAL="MAT_MATERIAL";

//    /**
//     * mat_model 型号
//     */
//    private static final String MAT_MODEL="MAT_MODEL";
//
//    /**
//     * mat_norm 规格
//     */
//    private static final String MAT_NORM="MAT_NORM";


    /**
     * mat_norm 规格型号
     */
    private static final String SPECIFICATIONS = "SPECIFICATIONS";

    /**
     * mat_norm 是否食品级
     */
    private static final String IS_FOOD_GRADE = "IS_FOOD_GRADE";

    /**
     * mat_norm 包装规格
     */
    private static final String PACK_SPECIFICATIONS = "PACK_SPECIFICATIONS";

    /**
     * mat_norm 执行标准
     */
    private static final String EXECUTIVE_STANDARD = "EXECUTIVE_STANDARD";

    /**
     * mat_indu_stand_desc 行业标准描述
     */
//    private static final String MAT_INDU_STAND_DESC="MAT_INDU_STAND_DESC";

    /**
     * mat_legend 物料说明
     */
    private static final String MAT_LEGEND="MAT_LEGEND";

    /**
     * basic_mea_unit_id 基本计量单位
     */
    private static final String BASIC_MEA_UNIT_ID="BASIC_MEA_UNIT_ID";

    /**
     * note_appended 备注说明
     */
    private static final String NOTE_APPENDED="NOTE_APPENDED";

    /**
     * assign_factory_name 指定厂家名称
     */
    private static final String ASSIGN_FACTORY_NAME="ASSIGN_FACTORY_NAME";

    /**
     * order_unit 订单单位
     */
    private static final String ORDER_UNIT="ORDER_UNIT";

    /**
     * prod_group_code 产品组编码
     */
    private static final String PROD_GROUP_CODE="PROD_GROUP_CODE";

    /**
     * length 长度
     */
    private static final String LENGTH="LENGTH";

    /**
     * width 宽度
     */
    private static final String WIDTH="WIDTH";

    /**
     * height 高度
     */
    private static final String HEIGHT="HEIGHT";

    /**
     * mat_group_code 物料组编码
     */
    private static final String MAT_GROUP_CODE="MAT_GROUP_CODE";

    /**
     * first_class 低值易耗一级分类
     */
    private static final String FIRST_CLASS="FIRST_CLASS";

    /**
     * product_hierarchy_code 产品层次结构
     */
    private static final String PRODUCT_HIERARCHY_CODE="PRODUCT_HIERARCHY_CODE";

    /**
     * sap_mat_code SAP物料编码
     */
    private static final String SAP_MAT_CODE="SAP_MAT_CODE";

    /**
     * sap_mat_code 行业部门
     */
    private static final String INDUSTRY_DEPT="INDUSTRY_DEPT";


    //CON_低易工厂信息表
//    private CConFactoryInfo[] cConFactoryInfoItems;
//    //CON_低易库存单位转换关系表
//    private CConUnitConvertRel[] cConUnitConvertRelItems;
//    //CON_低易销售信息表
//    private CConSaleInfo[] cConSaleInfoItems;
    //来源系统
    private String source;


    /*
     * ======================= Siperian Package specifc ======================= This
     * section is specific to the siperian package, containing elements and methods
     * specific to siperian packages.
     */

    /*
     * The record that contains the data for this data object
     */
    private Record record;


    /*
     * The uid of this data object
     */
    public static String DATA_OBJECT_UID = "BASE_OBJECT.C_CON_CONSUMABLES";
    /**
     * The default constructor
     */
    public CConConsumables(){
        this.record = new Record();
        this.record.setSiperianObjectUid(DATA_OBJECT_UID);
    }
    /**
     * Construct an instance of HotelPreference from a specific {@link Record}
     *
     * @param record
     *            The {@link Record} to initialize this data object from
     */
    public CConConsumables(Record record){
        this.record = record;
        this.record.setSiperianObjectUid(DATA_OBJECT_UID);
    }

    /**
     * Get the raw record that contains the data for this data object
     *
     * @return The {@link Record} object
     */
    public Record toRecord() {
        return record;
    }
    /*
     * ============================ Getters/Setters ============================
     */
    public String getMatLegend() {
        Field field = record.getField(MAT_LEGEND);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setMatLegend(String matLegend) {
        if (record.getField(MAT_LEGEND) == null) {
            record.setField(new Field(MAT_LEGEND));
        }
        record.getField(MAT_LEGEND).setStringValue(matLegend);
    }
    public String getBasicMeaUnitId() {
        Field field = record.getField(BASIC_MEA_UNIT_ID);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setBasicMeaUnitId(String basicMeaUnitId) {
        if (record.getField(BASIC_MEA_UNIT_ID) == null) {
            record.setField(new Field(BASIC_MEA_UNIT_ID));
        }
        record.getField(BASIC_MEA_UNIT_ID).setStringValue(basicMeaUnitId);
    }
    public String getMatMaterial() {
        Field field = record.getField(MAT_MATERIAL);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setMatMaterial(String matMaterial) {
        if (record.getField(MAT_MATERIAL) == null) {
            record.setField(new Field(MAT_MATERIAL));
        }
        record.getField(MAT_MATERIAL).setStringValue(matMaterial);
    }

//    public String getMatModel() {
//        Field field = record.getField(MAT_MODEL);
//        return FieldUtil.getFieldStringValue(field);
//    }
//
//    public void setMatModel(String matModel) {
//        if (record.getField(MAT_MODEL) == null) {
//            record.setField(new Field(MAT_MODEL));
//        }
//        record.getField(MAT_MODEL).setStringValue(matModel);
//    }

    public String getAssignFactoryName() {
        Field field = record.getField(ASSIGN_FACTORY_NAME);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setAssignFactoryName(String assignFactoryName) {
        if (record.getField(ASSIGN_FACTORY_NAME) == null) {
            record.setField(new Field(ASSIGN_FACTORY_NAME));
        }
        record.getField(ASSIGN_FACTORY_NAME).setStringValue(assignFactoryName);
    }
    public String getFirstClass() {
        Field field = record.getField(FIRST_CLASS);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setFirstClass(String firstClass) {
        if (record.getField(FIRST_CLASS) == null) {
            record.setField(new Field(FIRST_CLASS));
        }
        record.getField(FIRST_CLASS).setStringValue(firstClass);
    }
    public String getProductHierarchyCode() {
        Field field = record.getField(PRODUCT_HIERARCHY_CODE);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setProductHierarchyCode(String productHierarchyCode) {
        if (record.getField(PRODUCT_HIERARCHY_CODE) == null) {
            record.setField(new Field(PRODUCT_HIERARCHY_CODE));
        }
        record.getField(PRODUCT_HIERARCHY_CODE).setStringValue(productHierarchyCode);
    }
    public String getRowidObject() {
        Field field = record.getField(ROWID_OBJECT);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setRowidObject(String rowidObject) {
        if (record.getField(ROWID_OBJECT) == null) {
            record.setField(new Field(ROWID_OBJECT));
        }
        record.getField(ROWID_OBJECT).setStringValue(rowidObject);
    }
    public String getOrderUnit() {
        Field field = record.getField(ORDER_UNIT);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setOrderUnit(String orderUnit) {
        if (record.getField(ORDER_UNIT) == null) {
            record.setField(new Field(ORDER_UNIT));
        }
        record.getField(ORDER_UNIT).setStringValue(orderUnit);
    }
    public String getSecondClass() {
        Field field = record.getField(SECOND_CLASS);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setSecondClass(String secondClass) {
        if (record.getField(SECOND_CLASS) == null) {
            record.setField(new Field(SECOND_CLASS));
        }
        record.getField(SECOND_CLASS).setStringValue(secondClass);
    }
    public String getThirdClass() {
        Field field = record.getField(THIRD_CLASS);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setThirdClass(String thirdClass) {
        if (record.getField(THIRD_CLASS) == null) {
            record.setField(new Field(THIRD_CLASS));
        }
        record.getField(THIRD_CLASS).setStringValue(thirdClass);
    }
    public String getIsAssignFactory() {
        Field field = record.getField(IS_ASSIGN_FACTORY);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setIsAssignFactory(String isAssignFactory) {
        if (record.getField(IS_ASSIGN_FACTORY) == null) {
            record.setField(new Field(IS_ASSIGN_FACTORY));
        }
        record.getField(IS_ASSIGN_FACTORY).setStringValue(isAssignFactory);
    }
    public String getDemensionUnitCode() {
        Field field = record.getField(DEMENSION_UNIT_CODE);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setDemensionUnitCode(String demensionUnitCode) {
        if (record.getField(DEMENSION_UNIT_CODE) == null) {
            record.setField(new Field(DEMENSION_UNIT_CODE));
        }
        record.getField(DEMENSION_UNIT_CODE).setStringValue(demensionUnitCode);
    }
    public String getMatClassCode() {
        Field field = record.getField(MAT_CLASS_CODE);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setMatClassCode(String matClassCode) {
        if (record.getField(MAT_CLASS_CODE) == null) {
            record.setField(new Field(MAT_CLASS_CODE));
        }
        record.getField(MAT_CLASS_CODE).setStringValue(matClassCode);
    }

    public String getMatGroupCode() {
        Field field = record.getField(MAT_GROUP_CODE);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setMatGroupCode(String matGroupCode) {
        if (record.getField(MAT_GROUP_CODE) == null) {
            record.setField(new Field(MAT_GROUP_CODE));
        }
        record.getField(MAT_GROUP_CODE).setStringValue(matGroupCode);
    }

//    public String getMatNorm() {
//        Field field = record.getField(MAT_NORM);
//        return FieldUtil.getFieldStringValue(field);
//    }
//
//    public void setMatNorm(String matNorm) {
//        if (record.getField(MAT_NORM) == null) {
//            record.setField(new Field(MAT_NORM));
//        }
//        record.getField(MAT_NORM).setStringValue(matNorm);
//    }

//    public String getMatInduStandDesc() {
//        Field field = record.getField(MAT_INDU_STAND_DESC);
//        return FieldUtil.getFieldStringValue(field);
//    }
//
//    public void setMatInduStandDesc(String matInduStandDesc) {
//        if (record.getField(MAT_INDU_STAND_DESC) == null) {
//            record.setField(new Field(MAT_INDU_STAND_DESC));
//        }
//        record.getField(MAT_INDU_STAND_DESC).setStringValue(matInduStandDesc);
//    }

    public String getMatTypeCode() {
        Field field = record.getField(MAT_TYPE_CODE);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setMatTypeCode(String matTypeCode) {
        if (record.getField(MAT_TYPE_CODE) == null) {
            record.setField(new Field(MAT_TYPE_CODE));
        }
        record.getField(MAT_TYPE_CODE).setStringValue(matTypeCode);
    }
    public String getMatDesc() {
        Field field = record.getField(MAT_DESC);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setMatDesc(String matDesc) {
        if (record.getField(MAT_DESC) == null) {
            record.setField(new Field(MAT_DESC));
        }
        record.getField(MAT_DESC).setStringValue(matDesc);
    }
    public String getMatName() {
        Field field = record.getField(MAT_NAME);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setMatName(String matName) {
        if (record.getField(MAT_NAME) == null) {
            record.setField(new Field(MAT_NAME));
        }
        record.getField(MAT_NAME).setStringValue(matName);
    }
    public String getNoteAppended() {
        Field field = record.getField(NOTE_APPENDED);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setNoteAppended(String noteAppended) {
        if (record.getField(NOTE_APPENDED) == null) {
            record.setField(new Field(NOTE_APPENDED));
        }
        record.getField(NOTE_APPENDED).setStringValue(noteAppended);
    }
    public String getLength() {
        Field field = record.getField(LENGTH);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setLength(String length) {
        if (record.getField(LENGTH) == null) {
            record.setField(new Field(LENGTH));
        }
        record.getField(LENGTH).setStringValue(length);
    }
    public String getWidth() {
        Field field = record.getField(WIDTH);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setWidth(String width) {
        if (record.getField(WIDTH) == null) {
            record.setField(new Field(WIDTH));
        }
        record.getField(WIDTH).setStringValue(width);
    }
    public String getHeight() {
        Field field = record.getField(HEIGHT);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setHeight(String height) {
        if (record.getField(HEIGHT) == null) {
            record.setField(new Field(HEIGHT));
        }
        record.getField(HEIGHT).setStringValue(height);
    }
    public String getProdGroupCode() {
        Field field = record.getField(PROD_GROUP_CODE);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setProdGroupCode(String prodGroupCode) {
        if (record.getField(PROD_GROUP_CODE) == null) {
            record.setField(new Field(PROD_GROUP_CODE));
        }
        record.getField(PROD_GROUP_CODE).setStringValue(prodGroupCode);
    }
    public String getIndustryDept() {
        Field field = record.getField(INDUSTRY_DEPT);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setIndustryDept(String industryDept) {
        if (record.getField(INDUSTRY_DEPT) == null) {
            record.setField(new Field(INDUSTRY_DEPT));
        }
        record.getField(INDUSTRY_DEPT).setStringValue(industryDept);
    }
    public String getSapMatCode() {
        Field field = record.getField(SAP_MAT_CODE);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setSapMatCode(String sapMatCode) {
        if (record.getField(SAP_MAT_CODE) == null) {
            record.setField(new Field(SAP_MAT_CODE));
        }
        record.getField(SAP_MAT_CODE).setStringValue(sapMatCode);
    }



//    public CConFactoryInfo[] getcConFactoryInfoItems() {
//        return cConFactoryInfoItems;
//    }
//
//    public void setcConFactoryInfoItems(CConFactoryInfo[] cConFactoryInfoItems) {
//        this.cConFactoryInfoItems = cConFactoryInfoItems;
//    }
//
//    public CConUnitConvertRel[] getcConUnitConvertRelItems() {
//        return cConUnitConvertRelItems;
//    }
//
//    public void setcConUnitConvertRelItems(CConUnitConvertRel[] cConUnitConvertRelItems) {
//        this.cConUnitConvertRelItems = cConUnitConvertRelItems;
//    }
//
//    public CConSaleInfo[] getcConSaleInfoItems() {
//        return cConSaleInfoItems;
//    }
//
//    public void setcConSaleInfoItems(CConSaleInfo[] cConSaleInfoItems) {
//        this.cConSaleInfoItems = cConSaleInfoItems;
//    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getSpecifications() {
        Field field = record.getField(SPECIFICATIONS);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setSpecifications(String specifications) {
        if (record.getField(SPECIFICATIONS) == null) {
            record.setField(new Field(SPECIFICATIONS));
        }
        record.getField(SPECIFICATIONS).setStringValue(specifications);
    }

    public String getIsFoodGrade() {
        Field field = record.getField(IS_FOOD_GRADE);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setIsFoodGrade(String spaName) {
        if (record.getField(IS_FOOD_GRADE) == null) {
            record.setField(new Field(IS_FOOD_GRADE));
        }
        record.getField(IS_FOOD_GRADE).setStringValue(spaName);
    }

    public String getPackSpecifications() {
        Field field = record.getField(PACK_SPECIFICATIONS);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setPackSpecifications(String spaName) {
        if (record.getField(PACK_SPECIFICATIONS) == null) {
            record.setField(new Field(PACK_SPECIFICATIONS));
        }
        record.getField(PACK_SPECIFICATIONS).setStringValue(spaName);
    }

    public String getExecutiveStandard() {
        Field field = record.getField(EXECUTIVE_STANDARD);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setExecutiveStandard(String spaName) {
        if (record.getField(EXECUTIVE_STANDARD) == null) {
            record.setField(new Field(EXECUTIVE_STANDARD));
        }
        record.getField(EXECUTIVE_STANDARD).setStringValue(spaName);
    }

}
